package photobox.account

import photobox.photo.Photo

/**
 * 用户积分
 */
class UserPoint {
    Integer  point //积分
    Photo   photo
    Integer pointType //操作  1为购买    2 为上传

    Date    dateCreated
    Date    lastUpdated

    static  final int  POINT_TYPE_PURCHASE = 1
    static  final int  POINT_TYPE_UPLOAD = 2

    static mapping = {
        table 'acc_user_point'
    }

    static belongsTo = [user:User]
    static constraints = {
        point  min:0, max: Integer.MAX_VALUE
        pointType  inList: [POINT_TYPE_PURCHASE, POINT_TYPE_UPLOAD]
    }
}
